/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.foundation.poi;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by cherry on 2016/4/18.
 */
public class testDrawExcel {

    private static Logger logger = LoggerFactory.getLogger(SampleExcelBuilder.class);

    public static void main (String []args) {
        SampleExcelBuilder sampleExcelBuilder = new SampleExcelBuilder();

        String path = "j:/test.xls";
        List<ExSheet> sheets = new ArrayList<>();

        for (int i=0; i<2; i++) {
            ExSheet exSheet = new ExSheet();
            exSheet.setName("EN" + i);

            List<ExCell> exCellList = new ArrayList<>();
            for (int j=0; j<3; j++) {
                ExCell exCell = new ExCell();

                if (j == 2) {

                    exCell.setCellType(ExCellType.IMAGE);
                    Integer [] coordinate = new Integer[] {0, 0, 1023, 25, j+3, j+4,j+6, j+8};
                    exCell.setCoordinate(coordinate);
                    exCell.setValue("j:/a.png");
                    exCellList.add(exCell);
                    continue;
                }
                exCell.setCellType(ExCellType.TEXT);
                Integer [] coordinate = new Integer[] {0, j};
                exCell.setCoordinate(coordinate);
                exCell.setValue(j+i+"a");
                exCellList.add(exCell);
            }

            exSheet.setExCells(exCellList);
            sheets.add(exSheet);
        }

        try {

//            sampleExcelBuilder.drawExcel(path, sheets);
        }catch (Exception e) {

            System.out.println(e.getMessage());
        }
    }
}
